package com.czc.controller;

import com.czc.entities.CommonResult;
import com.czc.entities.Payment;
import com.czc.service.FeignPaymentService;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
public class FeignOrderController {
    @Resource
    private FeignPaymentService feignPaymentService;

    private String serverPort;


    @GetMapping(value = "/consumer/payment/get/{id}")
    public CommonResult<Payment> getPaymentById(@PathVariable("id") Long id){
        return feignPaymentService.getPaymentById(id);
    }

    //超时测试
    @GetMapping("/consumer/payment/feign/timeout")
    public String FeignTimeout(){
        return feignPaymentService.FeignTimeout();
    }
}
